app = angular.module 'app', ['ngResource', 'ui.router', 'angular.filter']

app.config ($stateProvider, $urlRouterProvider) ->
  $urlRouterProvider.when('', '/app/home')
  $urlRouterProvider.when('/', '/app/home')
  #$urlRouterProvider.otherwise('/notFound')

  $stateProvider.state 'notFound',
    url: '/notFound'
    controller: 'notFound'
    templateUrl: 'views/shared/notFound.html'

  $stateProvider.state 'app',
    url: '/app'
    controller: 'app'
    templateUrl: 'views/shared/master.html'
  $stateProvider.state 'app.home',
    url: '/home'
    controller: 'appHome'
    templateUrl: 'views/home.html'

app.run ($rootScope, $log) ->
  $log.info 'app.run'
